package com.cxhc.system.service.app.impl;

import java.util.List;

import com.cxhc.system.domain.app.QuestionBank;
import com.cxhc.system.mapper.app.QuestionBankMapper;
import com.cxhc.system.service.app.IQuestionBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 题库Service业务层处理
 * 
 * @author Dhq
 * @date 2024-08-01
 */
@Service
public class QuestionBankServiceImpl implements IQuestionBankService
{
    @Autowired
    private QuestionBankMapper questionBankMapper;

    /**
     * 查询题库
     * 
     * @param id 题库主键
     * @return 题库
     */
    @Override
    public QuestionBank selectQuestionBankById(Long id)
    {
        return questionBankMapper.selectQuestionBankById(id);
    }

    /**
     * 查询题库列表
     * 
     * @param questionBank 题库
     * @return 题库
     */
    @Override
    public List<QuestionBank> selectQuestionBankList(QuestionBank questionBank)
    {
        return questionBankMapper.selectQuestionBankList(questionBank);
    }

    /**
     * 通过examId查询题库列表
     * @param examinationId
     * @return
     */
    @Override
    public  List<QuestionBank> selectQuestionBankListByExamId(Long examinationId){
        return questionBankMapper.selectQuestionBankListByExamId(examinationId);
    }

    /**
     * 新增题库
     * 
     * @param questionBank 题库
     * @return 结果
     */
    @Override
    public int insertQuestionBank(QuestionBank questionBank)
    {
        return questionBankMapper.insertQuestionBank(questionBank);
    }

    /**
     * 修改题库
     * 
     * @param questionBank 题库
     * @return 结果
     */
    @Override
    public int updateQuestionBank(QuestionBank questionBank)
    {
        return questionBankMapper.updateQuestionBank(questionBank);
    }

    /**
     * 批量删除题库
     * 
     * @param ids 需要删除的题库主键
     * @return 结果
     */
    @Override
    public int deleteQuestionBankByIds(Long[] ids)
    {
        return questionBankMapper.deleteQuestionBankByIds(ids);
    }

    /**
     * 删除题库信息
     * 
     * @param id 题库主键
     * @return 结果
     */
    @Override
    public int deleteQuestionBankById(Long id)
    {
        return questionBankMapper.deleteQuestionBankById(id);
    }
}
